const shopModule = {
	state:{
		storeList:[],
		storePage:0,
		homeStoreList:[],
		homeStorePage:0
	},
	mutations:{
		setStoretList(state, data) {
			//data来自 actions里传入的data
			state.storeList = data;
			state.storePage = Math.ceil(data.length / 6);
		},
		pushStoreList(state,data){
			state.storeList.push(Object.assign(data))
			state.storePage = Math.ceil(state.storeList.length / 6);
		},
		setHomeStoreList(state,data){
	
			state.homeStoreList = data;
			state.homeStorePage = Math.ceil(data.length / 6);
		}
	},
	actions:{
		setStoreList(context,data) {
			context.commit('setStoretList', data);
		},
		setHomeStoreList(context,data){
			context.commit('setHomeStoreList', data);
		},
		pushStoreList(context,data){
			context.commit('pushStoreList',data)
		}
	},
	getters:{
		getStoreList(state){
			return state.storeList
		},
		getStorePage(state){
			return state.storePage
		},
		getHomeStoreList(state){
			return state.homeStoreList
		},
		getHomeStorePage(state){
			return state.homeStorePage
		}
	}
}
export default shopModule